<?php

namespace app\common\service;

class Amap
{
    public $key='551a461c35772bf1df2a9ea5cc0aecb9';

    public function regeo($lon,$lat){
        $url="https://restapi.amap.com/v3/geocode/regeo?key={$this->key}&location={$lon},{$lat}&extensions=all";

        $response=file_get_contents($url);

        if($response){
            $result=json_decode($response,true);
            return $result;
        }

        return false;
    }
}